package mvc.util;

import java.lang.reflect.Field;

import javax.servlet.http.HttpServletRequest;

import mvc.form.LoginForm;

public class FullBean {
	public static Object full( HttpServletRequest request){
		Object o=null;
		try {
			String sign=request.getParameter("sign");
			System.out.println(sign);
			Class clazz = Class.forName(sign);
			o=clazz.newInstance();
			Field[] fields = clazz.getDeclaredFields();
			for (Field f : fields) {
				f.setAccessible(true);
				f.set(o, request.getParameter(f.getName()));
				f.setAccessible(false);
			}
		} catch ( Exception e) {
			e.printStackTrace();
		}
		return o;
		
	}
}
